package ch9_9_4;
public class MyStack extends java.util.ArrayList<Object>{
	private static final long serialVersionUID = 1L;

	public Object peek(){
		return this.get(0);
	}
	
	public Object pop(){
		return this.remove(0);
	}
	
	public Object push(Object o){
		this.add(o);
		return o;
	}
	
	public int search(Object o){
		return this.lastIndexOf(o);
	}
	
	/** Override the to String in the Object class */
	public String toString(){
		return "stack: "+this.toString();
	}
}